home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #1 / Amiga Plus 1995 #1.iso / animationen / retina_fli_ii / xflick.h < prev    next >
C/C++ Source or Header  |  1994-12-13  |  2KB  |  75 lines

  1. /* xflick.h
  2.    Modified by Rob Poole
  3. */
  4.  
  5. #include <string.h>
  6. #include <fcntl.h>
  7.  
  8. #define FHD_EXPAND_SIZE 102
  9. #undef USE_MEMSET
  10.  
  11. struct fli_header
  12. {
  13.     unsigned long fhd_size;    /* Length of whole file */
  14.     int fhd_magic;  /* 0xaf11 */
  15.     int fhd_frames;
  16.     int fhd_width; 
  17.     int fhd_height;
  18.     int fhd_gap;
  19.     int fhd_flags;
  20.     int fhd_speed;  /* # of ticks between frames */
  21.     unsigned long fhd_next;
  22.     unsigned long fhd_frit;
  23.     char fhd_expand[FHD_EXPAND_SIZE];
  24. };
  25.  
  26. #define FR_EXPAND_SIZE 8
  27. struct frame_header 
  28. {
  29.     unsigned long fr_size;       /* Frame size in bytes */
  30.     int fr_magic;     /* 0xf1fa */
  31.     int fr_chunks;    /* Number of chunks */
  32.     char fr_expand[FR_EXPAND_SIZE];
  33. };
  34.  
  35. struct chunk_header
  36. {
  37.     unsigned long ch_bytes;    /* # of bytes in this chunk */
  38.     int ch_type;    /* Type of chunk */
  39. };
  40.  
  41. #define FLI_256_COLOR 4    /* Compressed color map (8 bit)*/
  42. #define FLI_DELTA 7     /* Wordwise run-lenght compressed frame */
  43. #define FLI_COLOR 11    /* Compressed color map (6 bit)*/
  44. #define FLI_LC    12    /* Line, compressed */
  45. #define FLI_BLACK 13    /* Set whole screen black */
  46. #define FLI_BRUN  15    /* Bytewise run-length compression-1st frame only */
  47. #define FLI_COPY  16    /* Uncompressed 64k to follow */
  48.  
  49. #define FLI_SYNC  255   /* Sent between each frame (NOT in .fli file) */
  50.  
  51. #define FLI_MAGIC 0xaf11
  52. #define FLC_MAGIC 0xaf12        /* flc magic */
  53.  
  54. #define MAXCOL 256
  55.  
  56. #define SIZE_HEADER 128
  57. #define SIZE_FHEADER 16
  58. #define SIZE_CHEADER 6
  59.  
  60. #define grab_short(p,l,h)\
  61.     (((((unsigned char *)(p))[l] & 0x000000ff) + ((((unsigned char *)p)[h] & 0x000000ff) <<8)))
  62. #define get_long(p) ((grab_short(p,2,3)<<16) + grab_short(p,0,1))
  63. #define get_short(p) (grab_short(p,0,1)) & 0x0000ffff
  64.  
  65. #define SHORTSIZE 2
  66. #define LONGSIZE 4
  67.  
  68. #ifdef USE_MEMSET
  69. #define bcopy(a,b,n) memcpy(b,a,n)
  70. #define bzero(a,n) memset(a,0,n)
  71. #endif
  72.  
  73. /* for AmigaDOS compatibility */
  74. #define xferror(str) fprintf(stderr, str)
  75.